@extends('backend::modal')
@section('title',trans($page_title))
@section('content')
    @if($goods->sku->isNotEmpty())
        <form method="post" action="{{route('b_ShopSpec_getSKUByGoodsId',['goods_id'=>$goods->goods_id])}}" id="edit-sku">
            <div>
                <table class="table table-bordered">
            <thead>
            <tr>
                <th>SKU编号</th><th>零售价</th><th>市场价</th><th>会员价</th><th>库存</th>
            </tr>
            </thead>
            <tbody>
            @foreach($goods->sku as $value)
                <tr>
                    <td class="text-truncate" style="width:80px;">
                        <span class="d-block">{{$value->sku_sn}}</span>
                        <span class="text-danger">规格:{{$value->goods_spec_items}}</span>
                    </td>
                    <td>
                        <input class="form-control" name="price[{{$value->id}}]" value="{{$value->price}}">
                    </td>
                    <td>
                        <input class="form-control" name="vip_price[{{$value->id}}]" value="{{$value->market_price}}">
                    </td>
                    <td>
                        <input class="form-control" name="market_price[{{$value->id}}]" value="{{$value->vip_price}}">
                    </td>
                    <td><input class="form-control" name="stock[{{$value->id}}]" value="{{$value->stock}}" /></td>
                </tr>
            @endforeach
            </tbody>
        </table>
            </div>
            <div class="d-flex justify-content-end">
                @component('backend::component.form.button')
                    @slot('title') 修改 @endslot
                    @slot('params') {"formId":"#edit-sku"} @endslot
                    @slot('class') btn-min-width ajax-form @endslot
                @endcomponent
            </div>
        </form>
    @else
        @component('backend::public.empty_page')
            @slot('info') 暂时没有货品信息 @endslot
        @endcomponent
    @endif
@endsection